package com.x.provider.api.mc.service;

import com.x.core.web.api.R;
import com.x.provider.api.mc.constants.McServiceNameConstants;
import com.x.provider.api.mc.model.dto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(contextId = "mcService", value = McServiceNameConstants.SERVICE_NAME)
public interface MessageRpcService {

    @PostMapping(McServiceNameConstants.MC_RPC_URL_PREFIX_MESSAGE + "/send")
    R<MessageDTO> sendMessage(@RequestBody MessageSendReqDTO sendMessageAO);

    @PostMapping(McServiceNameConstants.MC_RPC_URL_PREFIX_MESSAGE + "/send/raw")
    R<Long> sendMessageRaw(@RequestBody SendMessageRawDTO sendMessageAO);

    @PostMapping(McServiceNameConstants.MC_RPC_URL_PREFIX_MESSAGE + "/connect/info")
    R<ConnectInfoDTO> getConnectionInfo(@RequestBody ConnectionInfoGetReqDTO req);

    @PostMapping(McServiceNameConstants.MC_RPC_URL_PREFIX_MESSAGE + "/conversation/list")
    R<ConversationDTO> listConversation(@RequestBody ConversationListReqDTO req);

    @PostMapping(McServiceNameConstants.MC_RPC_URL_PREFIX_MESSAGE + "/conversation/get")
    R<ConversationDTO> getConversation(@RequestBody ConversationGetReqDTO req);

    @PostMapping(McServiceNameConstants.MC_RPC_URL_PREFIX_MESSAGE + "/list")
    R<MessageDTO> listMessage(@RequestBody MessageListReqDTO req);

    @PostMapping(McServiceNameConstants.MC_RPC_URL_PREFIX_MESSAGE + "/conversation/mark/as/read")
    R<Void> markConversationAsRead(@RequestBody ConversationMarkAsReadReqDTO req);

    @PostMapping(McServiceNameConstants.MC_RPC_URL_PREFIX_MESSAGE + "/total/unread/count")
    R<Long> getMessageTotalUnReadCount(@RequestBody MessageUnreadCountTotalGetReqDTO req);

    @PostMapping(McServiceNameConstants.MC_RPC_URL_PREFIX_MESSAGE + "/resume/set")
    R<Void> setCustomerResume(@RequestBody AttributeSetReqDTO attributeSetDTO);
}
